const Usecase = require('../../shared/usecase/Usecase')

class GetUserPage extends Usecase {
  constructor({ userRepo }) {
    super()
    this.userRepo = userRepo
  }
  async execute(query) {
    return await this.userRepo.paginate(
      query,
      {
        include: ['roleList'],
        order: [['lastLoginAt', 'DESC']],
      },
      ['username', 'phone', 'emial']
    )
  }
}

module.exports = GetUserPage
